package p.ithorns.integration.aop.introduction;

import org.springframework.context.annotation.AnnotationConfigApplicationContext;

/**
 * TestIntroductionAdvicor
 * TODO ithorns
 *
 * @author Ht.L
 * @date 2024-03-10 14:45
 * @since 1.0.0
 */
//@Configuration
//@ComponentScan(basePackages = "p.ithorns.integration.example.aop.introduction")
public class TestIntroductionAdvisor {

    public static void main(String[] args) {
        String basePackages = "p.ithorns.integration.example.aop.introduction";
        AnnotationConfigApplicationContext ctx = new AnnotationConfigApplicationContext(basePackages);

        Dog dog = ctx.getBean(Dog.class);
        dog.run();
        System.out.println("Animal.class.isAssignableFrom(dog.getClass()) = " + Animal.class.isAssignableFrom(dog.getClass()));
        Animal animal = (Animal) dog;
        animal.eat();
    }
}